import {
  queryLogList,
  systemNameListPost,
  deleteListPost,
  queryOptionList
} from '../services/log'

export default {
  namespace: 'log',
  state: {
    
  },

  subscriptions: {
    // setup({ dispatch, history }) {
    //   dispatch({
    //     type: 'queryAddressJson',
    //     payload: {},
    //   })
    // },
  },

  effects: {
    *queryLogList({ payload }, { call }) {
      const data = yield call(queryLogList, payload)
      // const { success, message, status, ...other } = data
      return data
      // if (success) {
      //   return data
      // } else {
      //   throw data
      // }
    },
    *systemNameListPost({ payload }, { call }) {
      const data = yield call(systemNameListPost, payload)
      // const { success, message, status, ...other } = data
      return data
    },
    *deleteListPost({ payload }, { call }) {
      const data = yield call(deleteListPost, payload)
      // const { success, message, status, ...other } = data
      return data
    },
    *queryOptionList({ payload }, { call }) {
      const data = yield call(queryOptionList, payload)
      // const { success, message, status, ...other } = data
      return data
    },
  },
  reducers: {
    setState(state, action) {
      return {
        ...state,
        ...action.payload,
      }
    },
  },
}
